﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApp6
{
    /// <summary>
    /// MyBindingMode.xaml 的交互逻辑
    /// </summary>
    public partial class MyBindingMode : Window
    {
        public MyBindingMode()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            var person = this.DataContext as PersonViewModel;
            MessageBox.Show($"name:{person.Name},age:{person.Age},address:{person.Address},job:{person.Job}");

            person.Name = "李四2";
            person.Age = 22;
            person.Address = "深圳市2";
            person.Job = "程序员2";
        }
    }
}
